package com.example.administrator.yunniuusedcar.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.example.administrator.common.base.BaseFragment;
import com.example.administrator.yunniuusedcar.activity.UserLoginActivity;
import com.example.administrator.yunniuusedcar.mineModular.ActivityMineCollection;
import com.example.administrator.yunniuusedcar.mineModular.ScanQRCodeActivity;
import com.example.administrator.yunniuusedcar.mineModular.ShoopingCarActivity;
import com.example.administrator.yunniuusedcar.mineModular.YuYueActivity;
import com.example.administrator.yunniuusedcar.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * Created by Administrator on 2017/11/28.
 * true: fragment_home01, fragment_choosecar02_news, ,fragment_choosecar03, item_mine_head,fragment_tools04,  fragment_mine05
 */

public class MineFragment5Model extends BaseFragment {

    @BindView(R.id.profile_UserImage)
    CircleImageView profileImage;
    @BindView(R.id.tv_useName)
    TextView tvUseName;
    @BindView(R.id.tv_yanzheng)
    TextView tvYanzheng;
    @BindView(R.id.RL_Used)
    RelativeLayout RLUsed;
    @BindView(R.id.iv_walletImage)
    ImageView ivWalletImage;
    @BindView(R.id.Rv_MyWallet)
    RelativeLayout RvMyWallet;
    @BindView(R.id.iv_OrderImage)
    ImageView ivOrderImage;
    @BindView(R.id.Rv_MyOrder)
    RelativeLayout RvMyOrder;
    @BindView(R.id.iv_CollectionImage)
    ImageView ivCollectionImage;
    @BindView(R.id.Rv_MyCollection)
    RelativeLayout RvMyCollection;
    @BindView(R.id.iv_ShoppingImage)
    ImageView ivShoppingImage;
    @BindView(R.id.Rv_ShoppingCar)
    RelativeLayout RvShoppingCar;
    @BindView(R.id.iv_ReservationImage)
    ImageView ivReservationImage;
    @BindView(R.id.Rv_Reservation)
    RelativeLayout RvReservation;
    @BindView(R.id.iv_ScanImage)
    ImageView ivScanImage;
    @BindView(R.id.Rv_Scan)
    RelativeLayout RvScan;
    @BindView(R.id.iv_invitationImage)
    ImageView ivInvitationImage;
    @BindView(R.id.Rv_invitationFrieds)
    RelativeLayout RvInvitationFrieds;
    @BindView(R.id.iv_invitationInfo)
    ImageView ivInvitationInfo;
    @BindView(R.id.Rv_invitationInfo)
    RelativeLayout RvInvitationInfo;
    @BindView(R.id.iv_SetImage)
    ImageView ivSetImage;
    @BindView(R.id.Rv_Set)
    RelativeLayout RvSet;
    Unbinder unbinder;
    private ImageView backed;

    @Override
    public int getLayoutRes() {
        return R.layout.fragment_mine05;
    }   //fragment_mine05

    @Override
    public void initView() {

    }


    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        unbinder = ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.profile_UserImage, R.id.tv_useName, R.id.tv_yanzheng, R.id.Rv_MyWallet, R.id.Rv_MyOrder, R.id.Rv_MyCollection, R.id.Rv_ShoppingCar,
              R.id.Rv_Reservation, R.id.Rv_Scan, R.id.Rv_invitationFrieds, R.id.Rv_invitationInfo, R.id.Rv_Set})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.profile_UserImage:   //登录头像
                startActivity(new Intent(getActivity(), UserLoginActivity.class));
                break;
            case R.id.tv_useName:     // 用户名
                break;
            case R.id.tv_yanzheng:   // 验证
                break;
            case R.id.Rv_MyWallet:   // 我的钱包
                break;
            case R.id.Rv_MyOrder:    // 我的订单
                break;
            case R.id.Rv_MyCollection:    //收藏
                initCollection();
                break;
            case R.id.Rv_ShoppingCar:   // 购物车
            startActivity(new Intent(getActivity(), ShoopingCarActivity.class));
                break;
            case R.id.Rv_Reservation:  // 预约服务
                initReservation();
                break;
            case R.id.Rv_Scan:          // 扫一扫:
                startActivity(new Intent(getActivity(), ScanQRCodeActivity.class));
                break;
            case R.id.Rv_invitationFrieds:  // 邀请好友
                break;
            case R.id.Rv_invitationInfo:      // 邀请明细
                break;
            case R.id.Rv_Set:                   // 设置
                break;
        }
    }

    private void initReservation() {
        startActivity(new Intent(getActivity(), YuYueActivity.class));

    }


    private void initCollection() {
        startActivity(new Intent(getActivity(), ActivityMineCollection.class));
    }
}
